
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>第 2 章 环境准备 · 大数据 bigdata_cm_atguigu 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="di-3-zhang-cm-an-zhuang-bu-shu.html" />
    
    
    <link rel="prev" href="./" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    第 1 章 CM 概述
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    第 2 章 环境准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="di-3-zhang-cm-an-zhuang-bu-shu.html">
            
                <a href="di-3-zhang-cm-an-zhuang-bu-shu.html">
            
                    
                    第 3 章 CM 安装部署
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >第 2 章 环境准备</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B2C;-2-&#x7AE0;-&#x73AF;&#x5883;&#x51C6;&#x5907;">&#x7B2C; 2 &#x7AE0; &#x73AF;&#x5883;&#x51C6;&#x5907;</h1>
<blockquote>
<p>&#x6CE8;&#x610F;: &#x4E3A;&#x4E86;&#x5728;&#x64CD;&#x4F5C;&#x8FC7;&#x7A0B;&#x4E2D;&#x4E0D;&#x51FA;&#x73B0;&#x5404;&#x79CD;&#x6743;&#x9650;&#x95EE;&#x9898;, &#x5EFA;&#x8BAE;&#x6240;&#x6709;&#x64CD;&#x4F5C;&#x90FD;&#x5728; <code>root</code> &#x7528;&#x6237;&#x4E0B;&#x6267;&#x884C;</p>
</blockquote>
<h2 id="21-&#x5185;&#x5B58;&#x5206;&#x914D;">2.1 &#x5185;&#x5B58;&#x5206;&#x914D;</h2>
<p>&#x7ED9; 3 &#x53F0;&#x865A;&#x62DF;&#x673A;&#x5206;&#x914D;&#x8DB3;&#x591F;&#x591A;&#x7684;&#x5185;&#x5B58;.</p>
<p>&#x5982;&#x679C;&#x662F; 16G &#x5185;&#x5B58;: &#x5219;&#x6309;&#x7167; <code>10,2,2</code> &#x5206;&#x914D;
&#x5982;&#x679C;&#x662F; 12G &#x5185;&#x5B58;: &#x5219;&#x6309;&#x7167; <code>6,2,2</code> &#x5206;&#x914D;
&#x5982;&#x679C;&#x662F; 8G &#x5185;&#x5B58;: &#x8BF7;&#x6DFB;&#x52A0;&#x5185;&#x5B58;</p>
<h2 id="22-&#x5B89;&#x88C5;-jdk">2.2 &#x5B89;&#x88C5; JDK</h2>
<p>JDK &#x7684;&#x7248;&#x672C; 1.8+, &#x5E76;&#x4E14;&#x914D;&#x7F6E;&#x73AF;&#x5883;&#x53D8;&#x91CF;<code>JAVA_HOME</code></p>
<h2 id="23-&#x5B89;&#x88C5;-mysql-&#x6570;&#x636E;&#x5E93;">2.3 &#x5B89;&#x88C5; Mysql &#x6570;&#x636E;&#x5E93;</h2>
<p>&#x4E0A;&#x5B89;&#x88C5;Mysql&#xFF0C;&#x914D;&#x7F6E;&#x76F8;&#x5E94;&#x7684;&#x7528;&#x6237;&#x6743;&#x9650;&#x3002; &#x5728;&#x8BB2;&#x89E3; Hive &#x7684;&#x65F6;&#x5019;&#x5E94;&#x8BE5;&#x5DF2;&#x7ECF;&#x90FD;&#x5B89;&#x88C5;&#x597D;&#x4E86;</p>
<h2 id="24-&#x5173;&#x95ED;-selinux">2.4 &#x5173;&#x95ED; <code>SELINUX</code></h2>
<p>SELINUX &#x662F; Security Enhanced Linux &#x7684;&#x7F29;&#x5199;, &#x7528;&#x4E8E;&#x5B89;&#x5168;&#x5F3A;&#x5316; Linux.</p>
<p>&#x56E0;&#x4E3A; centos &#x7684;&#x6240;&#x6709;&#x8BBF;&#x95EE;&#x6743;&#x9650;&#x90FD;&#x662F;&#x6709; SELinux &#x6765;&#x7BA1;&#x7406;&#x7684;&#xFF0C;&#x4E3A;&#x4E86;&#x907F;&#x514D;&#x6211;&#x4EEC;&#x5B89;&#x88C5;&#x4E2D;&#x7531;&#x4E8E;&#x6743;&#x9650;&#x5173;&#x7CFB;&#x800C;&#x5BFC;&#x81F4;&#x7684;&#x5931;&#x8D25;&#xFF0C;&#x6211;&#x4EEC;&#x5C06;&#x5176;&#x5173;&#x95ED;&#xFF0C;&#x4EE5;&#x540E;&#x8DDF;&#x6839;&#x636E;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x91CD;&#x65B0;&#x7BA1;&#x7406;&#x3002;</p>
<blockquote>
<p>&#x67E5;&#x770B; <code>SELINUX</code> &#x7684;&#x72B6;&#x6001;</p>
</blockquote>
<pre class="language-"><code class="lang-bash">/etc/selinux &#xBB; sestatus                                                                                      
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted
</code></pre>
<h3 id="&#x4E34;&#x65F6;&#x5173;&#x95ED;">&#x4E34;&#x65F6;&#x5173;&#x95ED;</h3>
<pre class="language-"><code class="lang-bash">setenforce 0
</code></pre>
<p>&#x68C0;&#x6D4B;&#x5185;&#x5B58;&#x4E2D;&#x7684;&#x72B6;&#x6001;:</p>
<pre class="language-"><code class="lang-bash">getenforce
</code></pre>
<h3 id="&#x6C38;&#x4E45;&#x5173;&#x95ED;">&#x6C38;&#x4E45;&#x5173;&#x95ED;</h3>
<p>&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;<code>/etc/selinux/config</code>&#xFF08;&#x91CD;&#x542F;&#x751F;&#x6548;&#xFF09;
<code>SELINUX=enforcing &#x6539;&#x4E3A;SELINUX=disabled</code></p>
<h2 id="25-ssh-&#x514D;&#x5BC6;&#x767B;&#x5F55;">2.5 SSH &#x514D;&#x5BC6;&#x767B;&#x5F55;</h2>
<p>&#x7ED9; root &#x8D26;&#x6237;&#x4E5F;&#x589E;&#x52A0;&#x4E09;&#x53F0;&#x8BBE;&#x5907;&#x4E4B;&#x95F4;&#x7684;&#x514D;&#x5BC6;&#x767B;&#x5F55;</p>
<h2 id="26-&#x4E0B;&#x8F7D;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;">2.6 &#x4E0B;&#x8F7D;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;</h2>
<p>&#x5206;&#x522B;&#x5728;&#x4E09;&#x53F0;&#x8282;&#x70B9;&#xFF08;&#x6240;&#x6709;agent&#x7684;&#x8282;&#x70B9;&#xFF09;&#x4E0A;&#x6267;&#x884C;&#x4E0B;&#x8F7D;&#x7B2C;&#x4E09;&#x65B9;&#x4F9D;&#x8D56;</p>
<pre class="language-"><code class="lang-bash">yum -y <span class="token function">install</span> <span class="token function">chkconfig</span> python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb
</code></pre>
<h2 id="27-&#x5728;-mysql-&#x4E2D;&#x521B;&#x5EFA;-cm-&#x9700;&#x8981;&#x7528;&#x5230;&#x7684;&#x6570;&#x636E;&#x5E93;">2.7 &#x5728; Mysql &#x4E2D;&#x521B;&#x5EFA; CM &#x9700;&#x8981;&#x7528;&#x5230;&#x7684;&#x6570;&#x636E;&#x5E93;</h2>
<ol>
<li>&#x96C6;&#x7FA4;&#x76D1;&#x63A7;&#x6570;&#x636E;&#x5E93;<pre class="language-"><code class="lang-sql"><span class="token keyword">create</span> <span class="token keyword">database</span> amon <span class="token keyword">DEFAULT</span> <span class="token keyword">CHARSET</span> utf8 <span class="token keyword">COLLATE</span> utf8_general_ci<span class="token punctuation">;</span>
</code></pre>
</li>
<li>Hive &#x6570;&#x636E;&#x5E93;<pre class="language-"><code class="lang-sql"><span class="token keyword">create</span> <span class="token keyword">database</span> hive <span class="token keyword">DEFAULT</span> <span class="token keyword">CHARSET</span> utf8 <span class="token keyword">COLLATE</span> utf8_general_ci<span class="token punctuation">;</span>
</code></pre>
</li>
<li>oozie &#x6570;&#x636E;&#x5E93;<pre class="language-"><code class="lang-sql"><span class="token keyword">create</span> <span class="token keyword">database</span> oozie <span class="token keyword">DEFAULT</span> <span class="token keyword">CHARSET</span> utf8 <span class="token keyword">COLLATE</span> utf8_general_ci<span class="token punctuation">;</span>
</code></pre>
</li>
<li>hue &#x6570;&#x636E;&#x5E93;<pre class="language-"><code class="lang-sql"><span class="token keyword">create</span> <span class="token keyword">database</span> hue <span class="token keyword">DEFAULT</span> <span class="token keyword">CHARSET</span> utf8 <span class="token keyword">COLLATE</span> utf8_general_ci<span class="token punctuation">;</span>
</code></pre>
</li>
</ol>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-03-18 14:34:02
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: 第 1 章 CM 概述">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="di-3-zhang-cm-an-zhuang-bu-shu.html" class="navigation navigation-next " aria-label="Next page: 第 3 章 CM 安装部署">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"第 2 章 环境准备","level":"1.2","depth":1,"next":{"title":"第 3 章 CM 安装部署","level":"1.3","depth":1,"path":"di-3-zhang-cm-an-zhuang-bu-shu.md","ref":"di-3-zhang-cm-an-zhuang-bu-shu.md","articles":[]},"previous":{"title":"第 1 章 CM 概述","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"http://bigdataatguigu.applinzi.com/"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 bigdata_cm_atguigu 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"chapter1.md","mtime":"2019-03-18T06:34:02.937Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-18T06:33:29.219Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

